#pragma once
#include <iostream>
#include <string>
#include <unistd.h>
#include <functional>

using namespace std;
using cb_t = function<void(int, const string&, const uint16_t&)>;

class Task
{
public:
    Task()
    {
    }

    Task(int sock, string& ip, uint16_t& port, cb_t cb)
        : _sock(sock), _ip(ip), _port(port), _cb(cb){
    }

    void operator()(){
        _cb(_sock, _ip, _port);
    }

    ~Task()
    {
    }

private:
    int _sock;
    string _ip;
    uint16_t _port;
    cb_t _cb;
};